﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SnakeGame
{
    class Snake
    {
        public int X { get; set; }
        public int Y { get; set; }
        protected Random rnd;

        public Snake(int x, int y)
        {
            X = x;
            Y = y;
            rnd = new Random();
        }

        public void MoveUp()
        { Y--; }

        public void MoveDown()
        { Y++; }

        public void MoveLeft()
        { X--; }

        public void MoveRight()
        { X++; }

        public bool IsOnPosition(int positionX, int positionY)
        {
            if (X == positionX && Y == positionY)
                return true;
            return false;
        }
    }

    class ConsoleSnake : Snake
    {
        public char NodeSymbol { get; private set; }
        public ConsoleColor NodeColor { get; private set; }

        public ConsoleSnake(int x, int y, char nodeSymbol, ConsoleColor nodeColor)
            : base(x, y)
        {
            NodeSymbol = nodeSymbol;
            NodeColor = nodeColor;
        }

    }
}
